<%@include file="/html/ccbs/portlet/hr_admin/init.jsp"%>

<%
	String toolbarItem = ParamUtil.getString(request, "toolbarItem", "view-all");
%>

<div class="lfr-portlet-toolbar">
	
	<portlet:renderURL var="viewAllURL">
		<portlet:param name="jspPage" value="/html/ccbs/portlet/hr_admin/view.jsp"/>
	</portlet:renderURL>
	
	<span class="lfr-toolbar-button view-button <%=toolbarItem.equals("view-all") ? "current" : StringPool.BLANK%>">
		<a href="<%= viewAllURL %>"><liferay-ui:message key="view-all"/></a>
	</span>
		
	<c:if test="<%= PortletPermissionUtil.contains(permissionChecker, portletDisplay.getId(), ActionKeys.ADD_MERCHANT) || PortletPermissionUtil.contains(permissionChecker,portletDisplay.getId(), ActionKeys.ADD_AGENT) %>">
		
		<liferay-portlet:renderURL varImpl="portletURL">
			<liferay-portlet:param name="backURL" value="<%= viewAllURL %>"/>
		</liferay-portlet:renderURL>

		<liferay-ui:icon-menu align="left" cssClass='<%= "lfr-toolbar-button add-button " + (toolbarItem.equals("add") ? "current" : StringPool.BLANK) %>' direction="down" extended="<%= false %>" icon='<%= themeDisplay.getPathThemeImages() + "/common/add.png" %>' message="add">
			
			
			<c:if test='<%= PortletPermissionUtil.contains(permissionChecker,portletDisplay.getId(), ActionKeys.ADD_AGENT) %>'>
				
				<%
					portletURL.setParameter("jspPage", "/html/ccbs/portlet/hr_admin/edit_agent.jsp");
				%>
				
				<liferay-ui:icon
					image="user_icon"
					message="agent"
					method="get"
					url="<%= portletURL.toString() %>"
				/>
			</c:if>
			
			<c:if test='<%= PortletPermissionUtil.contains(permissionChecker, portletDisplay.getId(), ActionKeys.ADD_MERCHANT) %>'>
				
				<%
					portletURL.setParameter("jspPage", "/html/ccbs/portlet/hr_admin/edit_merchant.jsp");
				%>
				
				<liferay-ui:icon
					image="organization_icon"
					message="merchant"
					method="get"
					url="<%= portletURL.toString() %>"
				/>
			</c:if>

		</liferay-ui:icon-menu>
	</c:if>
</div>